import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

// 创建路由规则
const routes = [
  // 配置首页显示内容
  {
    path: '/',
    redirect: '/results'
  },
  {
    path: '/results/:keyword',
    name: 'results',
    component: () => import(/* webpackChunkName: "results" */ '../views/Results.vue')
  },
  {
    // 如果这里不使用动态路由：id，使用player/123是匹配不到组件
    path: '/player/:id',
    name: 'player',
    component: () => import(/* webpackChunkName: "player" */ '../views/Player.vue')
  },
  {
    path: '/mv/:mvid',
    name: 'mv',
    component: () => import(/* webpackChunkName: "mv" */ '../views/Mv.vue')
  },
  {
    path: '/comment/:id',
    name: 'comment',
    component: () => import(/* webpackChunkName: "comment" */ '../views/Comment.vue')
  }
  
  // 播放界面

]
// 定义路由规则
const router = new VueRouter({
  routes
})

export default router
